package ltg.ibutton.aquaroom;

import java.util.ArrayList;
import java.util.Iterator;

import ltg.ibutton.core.Button;
import ltg.ibutton.core.Concept;
import ltg.ibutton.core.Reader;
import ltg.ibutton.core.Simulation;

public class AquaRoom extends Simulation {	
	
	public AquaRoom() {
		super();
	}	
	
	protected ArrayList<String> getTriggeredProbes() { 
		return AquaRoomPersistence.getTriggeredProbes();
	}
	
	@Override
	public ArrayList<Concept> getSimulationState() {
		ArrayList<Concept> c = new ArrayList<Concept>();
		for(Iterator<Reader> i = this.machine.getAttachedReaders().iterator(); i.hasNext();) {
			Reader r = i.next();
			for(Iterator<Button> j = r.getAttachedButtons().iterator(); j.hasNext();) {
				c.add(AquaRoomPersistence.getConceptFromBid(j.next().getId()));
			}
		}
		return c;
	}
}
